<script>
  let arr = [
    {
      id: 1,
      name: "zhangsan",
      age: 18,
    },
    {
      id: 2,
      name: "lisi",
      age: 19,
    },
    {
      id: 3,
      name: "wangwu",
      age: 20,
    },
    {
      id: 4,
      name: "zhaoliu",
      age: 21,
    },
    {
      id: 5,
      name: "qianqi",
      age: 22,
    },
  ];
</script>

<main>
  <ul>
    {#each arr as item, index (item.id)}
      <li>id：{item.id}，姓名：{item.name}，年龄：{item.age}</li>
    {/each}
  </ul>
</main>
